package whf.framework.exception;

import whf.framework.util.StringUtils;

/**
 * @author wanghaifeng
 *
 */
public class ServiceNotFoundException extends AppException{
	private final static long serialVersionUID = 0;
	
	private String serviceName;
	
	public ServiceNotFoundException(String msg){
		super(msg);
	}

	public ServiceNotFoundException(Throwable cause, String serviceName) {
		super(cause);
		this.serviceName = serviceName;
	}
	
	public String getMessage(){
		StringBuffer msg = new StringBuffer(super.getMessage());
		if(!StringUtils.isEmpty(this.serviceName))
			msg.append("\n\tService:").append(this.serviceName);
		return msg.toString();
	}
}
